package com.Ajava1704.for并发包下的类.ForCountDownLatch;

import java.util.concurrent.CountDownLatch;

/**
 * 作者: LCG
 * 日期: 2020/2/11 10:42
 * 描述:
 */
public class ForCountRunable implements Runnable {

    private CountDownLatch countDownLatch;

    public ForCountRunable(CountDownLatch countDownLatch, int time) {
        this.countDownLatch = countDownLatch;
        this.time = time;
    }

    private int time;


    @Override
    public void run() {

        try {
            Thread.sleep(time*1000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        System.out.println(Thread.currentThread().getName()+"同学到达门口===============");
        countDownLatch.countDown();
    }
}
